package graph;

import java.util.Arrays;

public class MGraphTest {
    public static void main(String[] args) {
        MGraph graph = new MGraph(10);
        graph.addEdge(1, 2);
        graph.addEdge(2, 3);
        graph.addEdge(4, 10);
        graph.addEdge(4, 5);
        graph.addEdge(7, 5);
        graph.addEdge(2, 8);
        graph.addEdge(9, 8);
        graph.addEdge(7, 6);
        System.out.println("边数" + graph.E());
        System.out.println("节点数" + graph.V());
        System.out.println("图:\n" + graph.toString());
        System.out.println("节点2的邻接点:" + Arrays.toString(graph.adj(2)));
        System.out.println("节点2的度:" + graph.getDegree(2));
    }
}